package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhentao.model.common.dtos.PageResponseResult;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.complaint.vo.ComplaintVo;
import com.zhentao.model.pay.dto.PayDto;
import com.zhentao.model.pay.pojo.AdMembershipCard;
import com.zhentao.model.pay.pojo.ApUserPaymentOrder;
import com.zhentao.model.pay.vo.PayVo;
import com.zhentao.service.ApUserPaymentOrderService;
import com.zhentao.mapper.ApUserPaymentOrderMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 许文倩
* @description 针对表【ap_user_payment_order】的数据库操作Service实现
* @createDate 2024-07-10 08:54:46
*/
@Service
public class ApUserPaymentOrderServiceImpl extends ServiceImpl<ApUserPaymentOrderMapper, ApUserPaymentOrder>
    implements ApUserPaymentOrderService{
    @Resource
    ApUserPaymentOrderMapper paymentOrderMapper;

    @Override
    public PageInfo<PayVo> getList(PayDto dto) {
        PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
        List<PayVo> payVos=paymentOrderMapper.payOrderList(dto.getNickName(),dto.getMembershipId());
        PageInfo<PayVo> payVoPageInfo=new PageInfo<>(payVos);
        return payVoPageInfo;
    }

    @Override
    public ResponseResult orderlist(Integer userId) {
        List<PayVo> apUserPaymentOrders = paymentOrderMapper.selectOrderList(userId);
        return ResponseResult.okResult(apUserPaymentOrders);
    }
}




